<?php
/**
 * Joomla! 1.5 component JoomGPSTracks
 *
 * @version $Id: view.html.php 2009-06-24 15:40:19 svn $
 * @author Michael Pfister
 * @package joomGPStracks
 * @subpackage backend
 * @license GNU/GPL
 * @filesource
 *
 */

// no direct access
defined('_JEXEC') or die('Restricted access');

// Import Joomla! libraries
jimport( 'joomla.application.component.view');
require_once JPATH_ROOT.DS.'components'.DS.'com_joomgpstracks'.DS.'helpers'.DS.'gpsClass.php';
/**
 *
 */
class JoomgpstracksViewDefault extends JView {
    /**
     *
     * @param obejct $tpl
     */
    function display($tpl = null) {

        $cfg =& JoomgpstracksHelper::getConfig();

        $gps = new gpsClass();

        $document =& JFactory::getDocument();
        $document->addScript('http://www.google.com/jsapi?key='.$cfg->apikey);
        $document->addScript('http://www.google.com/uds/api?file=uds.js&v=1.0&key='.$cfg->apikey);
        $document->addStylesheet('http://www.google.com/uds/css/gsearch.css');
        $document->addStylesheet('http://www.google.com/uds/solutions/localsearch/gmlocalsearch.css');

        $this->assignRef('cfg', $cfg);
        $this->assignRef('gps', $gps);
        
        parent::display($tpl);
    }
}
?>